package com.jl.utils.niuniu;


/**
 * @Auther: zhouhao
 * @Date: 2020/4/23
 * @Description:
 */
public enum  CardType {

    type1("1",10,"同花顺"),
    type2("2",9,"一条龙"),
    type3("3",9,"五小牛"),
    type4("4",8,"炸弹牛"),
    type5("5",7,"葫芦牛"),
    type6("6",6,"同花牛"),
    type7("7",5,"顺子牛"),
    type8("8",5,"金花牛"),
    type9("9",5,"银牛"),
    type10("10",4,"比翼牛"),
    type11("11",4,"牛牛"),
    type12("12",1,"牛九"),
    type13("13",1,"牛八"),
    type14("14",1,"牛七"),
    type15("15",1,"牛六"),
    type16("16",1,"牛五"),
    type17("17",1,"牛四"),
    type18("18",1,"牛三"),
    type19("19",1,"牛二"),
    type20("20",1,"牛一"),
    type21("21",1,"无牛");

    private String id;
    private Integer value;
    private String desc;
    //最大的牌面
    private Card maxFaces;

    CardType(String id, Integer value, String desc) {
        this.id = id;
        this.value = value;
        this.desc = desc;
    }
    
    CardType(String id, Integer value, String desc,Card maxFaces) {
        this.id = id;
        this.value = value;
        this.desc = desc;
        this.maxFaces = maxFaces;
    }

    public Card getMaxFaces() {
        return maxFaces;
    }

    public void setMaxFaces(Card maxFaces) {
        this.maxFaces = maxFaces;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static CardType getEnumById(String id){
        CardType[] values = CardType.values();
        for (CardType value : values) {
            if (id.equals(value.getId())){
                return value;
            }
        }
        return null;
    }

}
